{extend name="base" /}

{block name="content"}

<div class="ml-64">
	<div class="p-4">
	  	<ul class="md:flex-row nav nav-tabs flex flex-col flex-wrap list-none border-b-0 pl-0 mb-4" id="add-tab"
	    role="tablist">
		    {volist name="tab_list" id="item"}
		    <li class="nav-item" role="presentation">
		      <a href="{$item.url|admin_url|strtolower}" class="
		        nav-link
		        block
		        font-medium
		        text-xs
		        leading-tight
		        uppercase
		        border-x-0 border-t-0 border-b-2 border-transparent
		        px-6
		        py-3
		        my-2
		        hover:border-transparent hover:bg-gray-100
		        focus:border-transparent
		        {if $key == $group}
		        active
		        {/if}
		      " id="form_config-{$key}-tab" role="tab" aria-controls="form_config-{$key}"
		        aria-selected="true">{$item.title}</a>
		    </li>
		    {/volist}
	 	 </ul>
	  	<div class="tab-content" id="add-tabContent">
	    <div class="tab-pane fade show active" id="add-0" role="tabpanel" aria-labelledby="add-1-tab">
			{volist name="data_list" id="config"}
			{switch config.type}
			{case text}
			{:yoyo_render('input', [
				'name'  => $config['name'], 
				'label' => $config['title'], 
				'value' => $config['value'],
				'type'  => 'text',
			])}
			{/case}
			{case password}
			{:yoyo_render('input', [
				'name'  => $config['name'], 
				'label' => $config['title'], 
				'value' => $config['value'],
				'type'  => 'password',
			])}
			{/case}
			{case hidden}
			{:yoyo_render('input', [
				'name'  => $config['name'], 
				'value' => $config['value'],
				'type'  => 'hidden',
			])}	
			{/case}
			{case checkbox}
			{:yoyo_render('input', [
				'name'    => $config['name'], 
				'label'   => $config['title'], 
				'value'   => $config['value'],
				'type'    => 'check',
				'options' => $config['options'],
			])}
			{/case}
			{case radio}
			{:yoyo_render('radio', [
				'name'    => $config['name'], 
				'label'   => $config['title'], 
				'value'   => $config['value'],
				'options' => $config['options'],
				'inline'  => true,
			])}
			{/case}
			{case date}
			{:yoyo_render('datepicker', [
				'name'    => $config['name'], 
				'label'   => $config['title'], 
				'value'   => $config['value'],
			])}
			{/case}
			{case textarea||array}
			{:yoyo_render('textarea', [
				'name'  => $config['name'], 
				'label' => $config['title'], 
				'value' => $config['value'],
			])}
			{/case}
			{case static}
			{:yoyo_render('text', [
				'name'  => $config['name'], 
				'label' => $config['title'], 
				'value' => $config['value'],
			])}
			{/case}
			{case switch}
			{:yoyo_render('switchs', [
				'name'  => $config['name'], 
				'label' => $config['title'], 
				'value' => $config['value'],
			])}
			{/case}
			{case select}
			{:yoyo_render('select', [
				'name'    => $config['name'], 
				'label'   => $config['title'], 
				'value'   => $config['value'],
				'options' => $config['options'],
			])}
			{/case}
			{case tags}
			{:yoyo_render('tags', [
				'name'    => $config['name'], 
				'label'   => $config['title'], 
				'value'   => $config['value'],
			])}
			{/case}
			{case image}
			{:yoyo_render('image', [
				'name'    => $config['name'], 
				'label'   => $config['title'], 
				'value'   => $config['value'],
			])}
			{/case}
			{case file}
			{:yoyo_render('image', [
				'name'    => $config['name'], 
				'label'   => $config['title'], 
				'value'   => $config['value'],
			])}
			{/case}
			{case number}
			{:yoyo_render('input', [
				'name'  => $config['name'], 
				'label' => $config['title'], 
				'value' => $config['value'],
				'type'  => 'number',
			])}	
			{/case}
			{/switch}
			{/volist}
	    </div>
	  	</div>
	</div>
	<div class="clear-both">
		<button type="submit" class="ajax-post inline-block px-6 py-2.5 bg-blue-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-blue-700 hover:shadow-lg focus:bg-blue-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out" target-form="form-control">提交</button>
	</div>
</div>

{/block}

{block name="script"}
{/block}